package com.lyandwc.lw_bbs.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.sql.Timestamp;

@Data
@TableName("user")
public class User {
    @JSONField()
    Integer id;
    @JSONField(ordinal = 1)
    String username;
    @JSONField(ordinal = 2)
    String password;
    @JSONField(ordinal = 3)
    int status;
    @JSONField(ordinal = 4, format="yyyy-MM-dd HH:mm:ss")
    Timestamp createAt;
    @JSONField(ordinal = 5, defaultValue = " ")
    String email;
    @JSONField(ordinal = 6, defaultValue = " ")
    String bio;
    @JSONField(ordinal = 7)
    String avatar;
    @JSONField(ordinal = 8)
    int topicCount;
    @JSONField(ordinal = 9)
    int commentCount;

    @JSONField(ordinal = 10)
    @TableField(exist = false)
    String token;
}
